<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bigbox {
            position: relative;
            width: 400px;
            height: 400px;
            overflow: hidden;
            overflow-y: scroll;
        }

        .box {
            height: 100px;
        }

        .box:nth-child(1) {
            background-color: rgb(174, 75, 75);
        }

        .box:nth-child(2) {
            background-color: rgba(126, 186, 14, 0.778);
        }

        .box:nth-child(3) {
            background-color: rgb(202, 230, 42);
        }

        .box:nth-child(4) {
            background-color: rgb(71, 224, 211);
        }

        .box:nth-child(5) {
            background-color: rgb(84, 40, 204);
        }
    </style>
</head>

<body>
    <div class="bigbox">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
        <div class="box">4</div>
        <div class="box">5</div>
    </div>

    <script>
        var box = document.querySelectorAll('.box')
        var bigbox = document.querySelector('.bigbox')
        console.log(bigbox.scrollHeight);
        bigbox.addEventListener('scroll', () => {
            box.forEach(item => {
                console.log(item.offsetTop);
                console.log(item.scrollTop);
            })
        })
    </script>
</body>

</html>